package com.blockmeta.bbs.immodule.widget.chatboard;

import java.util.Arrays;

public class InputFieldQueryItem
{
	private String m_strKey;
	private String m_strTitle;
	private String m_strDetail;
	private String m_strImgUrl;
	private String m_strType;
	private String m_strTag;
	private String m_letter;

	public InputFieldQueryItem(String pType, String pKey, String pTitle, String pDetail, String pImgUrl, String pTag, String letter)
	{
		m_strType = pType;
		m_strKey = pKey;
		m_strTitle = pTitle;
		m_strDetail = pDetail;
		m_strImgUrl = pImgUrl;
		m_strTag = pTag;
		m_letter = letter;
	}

	public InputFieldQueryItem(String pType, String pKey, String pTitle, String pTag)
	{
		m_strType = pType;
		m_strKey = pKey;
		m_strTitle = pTitle;
		m_strTag = pTag;
	}

	public String getTag()
	{
		return m_strTag;
	}

	public String getKey()
	{
		return m_strKey;
	}

	public String getTitle()
	{
		return m_strTitle;
	}

	public String getDetail()
	{
		return m_strDetail;
	}

	public String getImgUrl()
	{
		return m_strImgUrl;
	}

	public String getType()
	{
		return m_strType;
	}

	public void setTitle(String m_strTitle)
	{
		this.m_strTitle = m_strTitle;
	}

	public void setTag(String m_strTag)
	{
		this.m_strTag = m_strTag;
	}

	public String getLetter() {
		return m_letter;
	}

	public void setLetter(String letter) {
		this.m_letter = letter;
	}

	@Override
	    public int hashCode() {
		  //return Objects.hash(m_strType, m_strKey);		  
		  return Arrays.asList(this.m_strKey, this.m_strKey).hashCode();
	    }
	
	@Override
	public boolean equals(Object tObject)
	{
		if (tObject != null && tObject instanceof InputFieldQueryItem)
		{
			InputFieldQueryItem tItem = (InputFieldQueryItem) tObject;
			String tKey = tItem.getKey();
			String tType = tItem.getType();

			if (tKey != null && tType != null && m_strType != null && m_strKey != null)
			{
				if (m_strType.equals(tType) && m_strKey.equals(tKey))
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
}
